// Mixins
.section-base(@dark-color, @light-color) {
  background: @light-color;

  a {
    color: @dark-color;
    cursor: pointer;
  }

  .line {
    background: @dark-color;
  }

  .section-add, .section-title .section-rename {
    .input-group {
      border-color: @dark-color;

      label {
        background: @dark-color;
        color: @light-color;
      }

      input {
        color: @dark-color;
        background: @light-color;
      }
    }
  }

  .profile, .section-title, .point-container {
    color: @dark-color;
  }

  .profile, .section-rename, .profile-edit, .point-add, .point-edit {
    .form-control, .bubble-icon {
      border-color: @dark-color;
      color: @dark-color;
    }

    .form-control::placeholder {
      color: lighten(@dark-color, 15%);
    }

    .btn {
      border-color: @dark-color;
      color: @dark-color;
    }

    .btn-link {
      border-color: transparent !important;
    }

    .input-group-addon {
      border-color: @dark-color;
      background-color: @dark-color;
      color: @light-color;
    }
  }

  .circle {
    color: @light-color;
    background-color: @dark-color;

    .chart {
      border-color: @dark-color;
      background-color: @light-color;
      color: @dark-color;
    }
  }

  .chart {
    border-color: @dark-color;
    background-color: @light-color;
    color: @dark-color;
  }

  .point .actions a:hover {
    background-color: @dark-color;
    color: @light-color;
  }

  .point-placeholder .point-container {
    border-color: @dark-color;
  }

  .point-picture .picture-point-image {
    border-color: @dark-color;
  }

  .section-black {
    background-color: @dark-color;

    a {
      color: darken(@light-color, 10%);

      &:hover {
        color: @light-color;
      }
    }

    .line {
      background: @light-color;
    }

    .section-add, .section-title .section-rename {
      .input-group {
        border-color: @light-color;

        label {
          background: @light-color;
          color: @dark-color;
        }

        input {
          color: @light-color;
          background: @dark-color;
        }
      }
    }

    .section-title, .point-container {
      color: @light-color;
    }

    .section-rename, .point-add, .point-edit {
      .form-control, .bubble-icon {
        border-color: @light-color;
        color: @light-color;
      }

      .form-control::placeholder {
        color: darken(@light-color, 15%);
      }

      .btn {
        border-color: @light-color;
        color: @light-color;
      }

      .input-group-addon {
        border-color: @light-color;
        background-color: @light-color;
        color: @dark-color;
      }
    }

    .circle {
      background-color: @light-color;
      color: @dark-color;

      .chart {
        border-color: @light-color;
        background-color: @dark-color;
        color: @light-color;
      }
    }

    .chart {
      border-color: @light-color;
      background-color: @dark-color;
      color: @light-color;
    }

    .point .actions a:hover {
      background-color: @light-color;
      color: @dark-color;
    }

    .point-placeholder .point-container {
      border-color: @light-color;
    }

    .point-picture .picture-point-image {
      border-color: @light-color;
    }
  }

  .profile-image .loading i {
    color: @dark-color;
  }

  .profile-image.done .loading i {
    color: @light-color;
  }

  .section-header .content {
    background: @light-color;
  }

  .section:last-of-type .line:before {
    color: @light-color;
    background: @dark-color;
  }

  .section.section-black:last-of-type .line:before {
    color: @dark-color;
    background: @light-color;
  }

  .section:before {
    background: @dark-color;
  }

  .section.section-black:before {
    background: @light-color;
  }

  .section:last-of-type:before {
    display: none;
  }
}

@keyframes loading {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

.form-control {
  -webkit-appearance: none;
}

.section {
  position: relative;
  z-index: @default-index;
  margin-top: 0;
  padding: 40px 0;
  width: 100%;

  .line {
    position: absolute;
    top: -20px;
    bottom: 0;
    left: 50%;
    z-index: @line-index;
    width: 1px;
  }

  &:last-of-type {
    padding-bottom: 200px;

    .line {
      bottom: 100px;
      margin-bottom: -50px;

      &:before {
        display: block;
        content: '';
        position: absolute;
        bottom: 0;
        z-index: @default-index;
        margin-left: -25px;
        width: 51px;
        height: 51px;
        border-radius: 50%;
      }
    }
  }

  &:before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    z-index: @default-index;
    margin: -15px;
    width: 31px;
    height: 31px;
    transform: rotate(315deg);
  }

  .top-actions {
    position: absolute;
    top: 30px;
    right: 30px;

    a {
      margin-left: 8px;
    }
  }

  .profile {
    padding: 0 20px;
  }

  .profile-image {
    position: absolute;
    top: -100px;
    left: 50%;
    z-index: @profile-index;
    margin-left: -100px;
    width: 200px;
    height: 200px;
    border: 2px solid darken(@starry-color-white, 1%);
    background-color: darken(@starry-color-white, 1%);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 50%;
  }

  .section-title {
    padding-right: 20px;
    margin-top: -30px;
    padding-bottom: 30px;
    text-align: right;

    span.name {
      font-size: 16px;
    }
  }

  .point {
    position: relative;
    width: 50%;
    min-height: 60px;
    padding: 0 20px;
    padding-right: 50px;
    backface-visibility: hidden;
    transition: opacity 0.4s ease;

    &.show-picture {
      min-height: 300px;
      margin-top: 10px;
      margin-bottom: 40px;
    }

    &.swing-out {
      .opacity(0);

      .circle {
        transform: scale(0.8);
      }

      .point-body {
        transform: translate(0, -5px);
        .opacity(0);
      }
    }

    &.swing-in {
      .opacity(1);

      .circle {
        transform: scale(1);
      }

      .point-body {
        transform: translate(0, 0);
        .opacity(1);
      }
    }
  }

  .point-container {
    margin-left: auto;
    margin-right: 0;
    padding-top: 5px;
    max-width: 400px;
    text-align: right;

    &.progress, &.icon {
      padding-top: 10px;

      .point-picture {
        top: 10px;
      }
    }

    &.text {
      padding-top: 15px;

      .point-picture {
        top: 15px;
      }
    }

    h3.title {
      margin-top: 0;
      font-size: 20px;
      font-weight: normal;

      a, a:hover {
        color: inherit !important;
        text-decoration: underline;
      }
    }

    .point-body {
      margin-bottom: 0;
      padding-bottom: 20px;
      font-size: 16px;
      transition: all 0.4s ease;

      h1, h2, h3, h4, h5 {
        font-size: 18px;
        font-weight: normal;
      }

      ul, ol {
        margin: 0;
        padding: 0;
      }

      li {
        list-style: none;
      }
    }
  }

  .circle {
    position: absolute;
    top: 0;
    z-index: @base-index;
    right: -11px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    transition: all 0.3s ease;

    .chart {
      position: relative;
      width: 31px;
      height: 31px;
      border-width: 1px;
      border-style: solid;
      border-radius: 50%;

      canvas {
        position: absolute;
        top: -1px;
        left: -1px;
      }
    }

    .fa {
      width: 31px;
      line-height: 31px;
      text-align: center;
      font-size: 18px;
      color: inherit;
    }
  }

  .circle-general {
    right: -16px;
    width: 31px;
    height: 31px;
  }

  .circle-large {
    right: -26px;
    width: 51px;
    height: 51px;

    .visible {
      width: 51px;
      line-height: 51px;
      text-align: center;
    }
  }

  .point-picture {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 90%;
    padding: 10px 50px;
    max-width: 400px;

    .picture-point-image {
      margin: 0 auto;
      width: 100%;
      background-position: center;
      background-size: contain;
      border: 5px solid white;
      background-color: rgba(255, 255, 255, 0.7);
    }
  }

  .point-right {
    padding-left: 50px;
    margin-left: 50%;

    .point-container {
      margin-left: 0;
      margin-right: auto;
      text-align: left;
    }

    .circle {
      right: auto;
      left: -10px;
    }

    .circle-general {
      right: auto;
      left: -15px;
    }

    .circle-large {
      right: auto;
      left: -25px;
    }

    .point-picture {
      left: auto;
      right: 100%;
      text-align: right;
    }
  }
}

.section-background {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.section-header {
  padding-top: 100px;
  padding-bottom: 30px;
  backface-visibility: hidden;
  text-align: center;

  .content {
    position: relative;
    z-index: @base-index;
    margin: 30px auto;
    margin-top: 40px;
    padding-bottom: 20px;
    max-width: 600px;
    text-align: center;

    h1 {
      font-size: 32px;
      padding-top: 20px;
      padding-bottom: 0;
    }

    .link {
      font-size: 15px;
      font-family: inherit;
      margin-top: 0;

      a {
        text-decoration: underline;
      }
    }

    .nav {
      display: inline-block;
      padding: 20px 0 10px;
      font-size: 16px;

      a {
        margin-right: 12px;

        &:last-of-type {
          margin-right: 0;
        }
      }
    }
  }
}

@media (max-width: 600px) {
  .section-background:before {
    display: none;
  }

  .section-header div.line {
    display: none;
  }

  .section:before, .section .line {
    left: 40px;
  }

  .section .point {
    width: 85%;
    margin-top: 0px;
    margin-left: 40px;
    padding-left: 40px;
    padding-right: 40px;

    .point-container {
      margin-left: 0;
      margin-right: auto;
      text-align: left;
    }

    .circle {
      right: auto;
      left: -10px;
    }

    .circle-general {
      right: auto;
      left: -15px;
    }

    .circle-large {
      right: auto;
      left: -25px;
    }

    .point-picture {
      left: auto;
      right: 100%;
      text-align: left;
    }
  }

  .section .point-picture {
    position: relative;
    display: block;
    min-height: 200px;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: auto;
    padding-left: 0;
    padding-right: 10px;
  }
}


body, body.black {
  .section-base(@starry-color-black, @starry-color-white);
}

body.gray {
  .section-base(@starry-color-gray, @starry-color-white);
}

body.green {
  .section-base(@starry-color-green, @starry-color-white);
}

body.blue {
  .section-base(@starry-color-blue, @starry-color-white);
}

body.pink {
  .section-base(@starry-color-pink, @starry-color-white);
}

body.red {
  .section-base(@starry-color-red, @starry-color-white);
}
